<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% 
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<base href="<%=basePath%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>briup安全中心</title>
<link rel="stylesheet" href="css/common.css"/>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/icons.css" />
<link rel="stylesheet" href="css/table.css" />
<link rel="stylesheet" href="css/newmain.css" />

<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">

$(function(){
	var username = "${sessionScope.user.username}";
	if (username.trim().length != 0) {
		$(".top_lr").prepend("<li><a href='SignOut'>退出</a></li>");
		$(".top_lr").prepend("<li><a>欢迎 <font  style='font-weight: 900;color: red;'>" + username + "</font></a></li>");
		$(".top_bars").prepend('<li><a href="confirmList.jsp">我的订单<span class="jt_down"></span></a>|</li>');
	} else { // 未登录
		$(".top_lr").prepend('<li><a href="login.jsp" style="color: red;">亲,请登入</a></li>');
	}
	
		$("input[name='info']").click(function(){
			
			var password=$("input[name='password']").val();
			var zip=$("input[name='zip']").val();
			var address=$("input[name='address']").val();
			var telephone=$("input[name='telephone']").val();
			var email=$("input[name='email']").val();
			
			if(password.trim().length==0){
				alert("密码不能为空");
				return false;
			}
			if(zip.trim().length==0){
				alert("邮编不能为空");
				return false;
			}
			if(isNaN(zip)){
				alert("邮编必须全为数字");
				return false;
			}
			if(zip.trim().length!=6){
				alert("邮编长度必须为6");
				return false;
			}
			if(address.trim().length==0){
				alert("地址栏不能为空");
				return false;
			}
			if(address.trim().length>20){
				alert("地址长度不能超过20个汉字");
				return false;
			}
			if(telephone.trim().length==0){
				alert("手机号不能为空");
				return false;
			}
			if(isNaN(telephone)){
				alert("手机号必须全为数字");
				return false;
			}
			if(telephone.trim().length!=11){
				alert("手机号长度必须为11位");
				return false;
			}
			var email=$("input[name='email']").val();
			var re= /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-_.])+[A-Za-z\d]{2,4}$/;
				if(re.test(email)){
				}else{
				alert("电子邮箱格式不正确");
				}
				if(email.values==""){
					alert("电子邮箱格式不正确");
				return false;
				}
     	});
	});
</script>
</head>
<body>
	<!--顶部-->
	<div class="top">
    	<div class="top_center">
    		<ul class="top_lr">
            	
                <li><a href="register.jsp">免费注册</a></li>
            </ul>
            <ul class="top_bars">
                
                <li><a href="index.jsp">关注杰普<span class="jt_down"></span></a>|</li>
                <li><a href="index.jsp">网站导航<span class="jt_down"></span></a></li>
            </ul>
        </div>
    </div>
    <!--头部-->
    <div class="header3">
    	<a href="index.jsp"><img src="images/logo.png"></a>
    	<div class="h3_center">
        	<div class="search_box">
            	<input type="text"/>
                <span>搜索</span>
            </div>
            <p>
			<c:forEach items="${applicationScope.cates}"   var="cate">
            	<a href="listCateBookSer?id=${cate.id}">${cate.name}</a>|
			</c:forEach>
            </p>
        </div>
        <div class="h3_right">
        	<div class="myyy">
            	<a href="user/userinfo.jsp">个人信息</a>
                <span class="sj_down"></span>
             </div>
            <div class="tsc">
           	  <a href="user/shopCart.jsp">去购物车结算</a>
              <span class="sj_right"> </span>
            </div>
        </div>
    </div>
    <!--头部导航-->
    <div class="nav_top">
    	<div class="nav_top_center">
            <div>
                全部图书分类
            </div>
            <ul>
               <li><a href="list.html">文学类</a></li>
                <li><a href="list.html">教育类</a></li>
                <li><a href="list.html">计算机</a></li>
                <li><a href="list.html">儿童类</a></li>
                <li><a href="list.html">漫画类</a></li>
            </ul>
        </div>
    </div>
    <div class="container4">
    	<div class="register_box">
    			<div class="head">
    				<h3>个人信息</h3>
    			</div>
    			<div class="security">
    				<form action="user/updateUserSer" method="post">
    					<ul class="list">
    						<li>
    								<input id="J_euserName" class="long" readonly="readonly" name="name" value="${sessionScope.user.username}" type="text" /> <!-- readonly="readonly" -->
    								<div class="name">用户名:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" name="password" value="${sessionScope.user.password}" type="text" />
    								<div class="name">密码:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" name="zip" value="${sessionScope.user.zip}" type="text" />
    								<div class="name">邮编:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" name="address" value="${sessionScope.user.address}" type="text" />
    								<div class="name">地址:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" name="phone" value="${sessionScope.user.phone}" type="text" />
    								<div class="name">电话:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" name="email" value="${sessionScope.user.email}" type="text" />
    								<div class="name">电子邮箱:</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						<li>
    								<input id="J_euserName" class="long" style="width:70px;font-size: large;cursor: pointer;text-align: center;line-height: 40px;"  value="修改" type="submit" name="info" />
    								<div class="name">&nbsp;</div>
    								<span id="J_eUserNameTipImg" class="icon"></span>
    								<div id="J_eUserNameTipInfo" class="ltip"></div>
    								<span class="placeholder" style="position: absolute;z-index: 20;color: rgb(153,153,153);top: 14px;left: 345px;line-height: 37px;"></span>
    						</li>
    						
    					</ul>
    				</form>
    			</div>
    	</div>
    </div>
 
    <!--脚部-->
    <div class="footer3">
    	<div class="f3_top">
        	<div class="f3_center">
                <div class="ts1">品目繁多 愉悦购物</div>
                <div class="ts2">正品保障 天天低价</div>
                <div class="ts3">极速物流 特色定制</div>
                <div class="ts4">优质服务 以客为尊</div>
            </div>
        </div>
        <div class="f3_middle">
        	<ul class="f3_center">
            	<li class="f3_mi_li01">
                	<h1>购物指南</h1>
                    <p>常见问题</p>
                    <p>找回密码</p>
                    <p>会员介绍</p>
                    <p>购物演示</p>
                </li>
                <li class="f3_mi_li01">
                	<h1>配送方式</h1>
                    <p>常见问题</p>
                    <p>找回密码</p>
                    <p>会员介绍</p>
                    <p>购物演示</p>
                </li>
                <li class="f3_mi_li01">
                	<h1>支付方式</h1>
                    <p>常见问题</p>
                    <p>找回密码</p>
                    <p>会员介绍</p>
                    <p>购物演示</p>
                </li>
                <li class="f3_mi_li01">
                	<h1>售后服务</h1>
                    <p>常见问题</p>
                    <p>找回密码</p>
                    <p>会员介绍</p>
                    <p>购物演示</p>
                </li>
                <li class="f3_mi_li01">
                	<h1>服务保障</h1>
                    <p>常见问题</p>
                    <p>找回密码</p>
                    <p>会员介绍</p>
                    <p>购物演示</p>
                </li>
                <li class="f3_mi_li06">
                	<h1>客服中心</h1>
                    <img src="images/qrcode_jprj.jpg" width="80px" height="80px">
                    <p>抢红包、疑问咨询、优惠活动</p>
                </li>
            </ul>
        </div>
         <div class="f3_bottom">
        	<p class="f3_links">
                <a href="#">关于我们</a>|
                <a href="#">联系我们</a>|
                <a href="#">友情链接</a>|
                <a href="#">供货商入驻</a> 
           	</p>
            <p>沪ICP备14033591号-8 杰普briup.com版权所有 杰普软件科技有限公司 </p>
          	<img src="images/police.png">
        </div>
    </div>

</body>
</html>